def bank_rate(x, p, y):
    sum1 = x
    index = 0
    while sum1<=y:
        if sum1<=y:
            sum1 = sum1 + x * (p/100)
            index += 1
    return index

bank_rate(100, 100, 200) == 1
bank_rate(400, 32, 743) == 3
bank_rate(400, 7, 1046) == 24